<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<script type="text/javascript" src="../../zxt/zxt.js"></script>
    <script>
    	importZXT("../../zxt");
    </script>
	
</head>

<body class="bodyBackground">

	  
	<div id="socket" style='width:600px' zxt="zxt.ui.OptBar" zxt.configFunc="configOptBar" style="background-color:#f3f8e6;">
		<div id="optButton2" zxt="zxt.ui.OptButton" zxt.label="edit" zxt.text="编辑" zxt.opt="edit" zxt.target="optC"></div>
	</div>
	<table>
		<tr>
			<td>getType()</td>
			<td>返回按钮的控件类型</td>
			<td><input type="button" name="getType" value="getType" 
				onclick="alert('操作栏的type为'+$zxtUI.socket.getType());"/></td>
		</tr>
		<tr>
			<td>addButton(button)</td>
			<td>工具栏新增按钮方法</td>
			<td><input type="button" name="addButton" value="addButton" 
				onclick="$zxtUI.socket.addButton(new zxt.ui.Button('addButton','addButton'));alert('操作栏增加了按钮');"/></td>
		</tr>
		<tr>
			<td>addCancelButton(target)</td>
			<td>添加取消按钮</td>
			<td><input type="button" name="addCancelButton" value="addCancelButton" 
				onclick="$zxtUI.socket.addCancelButton(optC);alert('操作栏增加了取消按钮');"/></td>
		</tr>
		<tr>
			<td>addDeleteButton(target)</td>
			<td>添加取消按钮</td>
			<td><input type="button" name="addDeleteButton" value="addDeleteButton" 
				onclick="$zxtUI.socket.addDeleteButton(optC);alert('操作栏增加了删除按钮');"/></td>
		</tr>
		<tr>
			<td>addEditButton(target)</td>
			<td>添加编辑按钮</td>
			<td><input type="button" name="addEditButton" value="addEditButton" 
				onclick="$zxtUI.socket.addEditButton(optC);alert('操作栏增加了编辑按钮');"/></td>
		</tr>
		<tr>
			<td>addNewButton(target)</td>
			<td>添加新建按钮</td>
			<td><input type="button" name="addNewButton" value="addNewButton" 
				onclick="$zxtUI.socket.addNewButton(optC);alert('操作栏增加了新建按钮');"/></td>
		</tr>
		<tr>
			<td>addQueryButton(target)</td>
			<td>添加查询按钮</td>
			<td><input type="button" name="addQueryButton" value="addQueryButton" 
				onclick="$zxtUI.socket.addQueryButton(optC);alert('操作栏增加了查询按钮');"/></td>
		</tr>
		<tr>
			<td>addResetButton(target)</td>
			<td>添加重置按钮</td>
			<td><input type="button" name="addResetButton" value="addResetButton" 
				onclick="$zxtUI.socket.addResetButton(optC);alert('操作栏增加了重置按钮');"/></td>
		</tr>
		<tr>
			<td>addSaveButton(target)</td>
			<td>添加保存按钮</td>
			<td><input type="button" name="addSaveButton" value="addSaveButton" 
				onclick="$zxtUI.socket.addSaveButton(optC);alert('操作栏增加了保存按钮');"/></td>
		</tr>
	</table>
    <div><a href="../index.html">返回</a></div>
</body>

</html>

<script type="text/javascript"">
	
	var optC = {
		id: function(){ return "optC"; },
		onMessage: function(msg){
			alert(msg.data.opt);
		},
		addAttachButton : function(but){
		},
		setParent : function(p){
		}		
	};
	$zxt.register(optC, "optC");
		

	function configOptBar(bar) {
		
	}
	
	$zxt.init();
	
</script>